package src.schoolWork;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: tao
 * Date: 2023-11-20
 * Time: 16:21
 */
public class Test3 {
    public static void main(String[] args) {
        String sourcePath = "D:/00.jpg";
        String destinationPath = "D:/001.jpg";

        try (InputStream inputStream = new FileInputStream(sourcePath);
             OutputStream outputStream = new FileOutputStream(destinationPath)) {
            byte[] buffer = new byte[1024];
            int bytesRead;
            while ((bytesRead = inputStream.read(buffer)) != -1) {
                outputStream.write(buffer, 0, bytesRead);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
